// strategy/PathPlanningContext.java
package org.example.strategy;

import org.example.model.FarmMachine;

public class PathPlanningContext {
    private PathPlanningStrategy strategy;

    public void setStrategy(PathPlanningStrategy strategy) {
        this.strategy = strategy;
    }

    public void planPath(FarmMachine machine) {
        if (strategy != null) {
            strategy.planPath(machine);
        } else {
            System.out.println("未设置路径规划策略");
        }
    }

    public String getCurrentStrategyName() {
        return strategy != null ? strategy.getStrategyName() : "无策略";
    }

    public PathPlanningStrategy getStrategy() {
        return strategy;
    }
}